package com.example.snackbar;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.example.snackbar.Adapter.selfListViewAdapter;

import java.util.ArrayList;

public class selfListView extends AppCompatActivity {

    ArrayList<Message> list = new ArrayList<>();
    ListView selfListView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_self_list_view);
        setList();
        selfListView = findViewById(R.id.selfListView);
        selfListView.setAdapter(new selfListViewAdapter(selfListView.this,R.layout.selflistview,list));
    }

    public void setList(){
        for (int i =0;i<1000;i++){
            Message message = new Message("哈利虎牙",R.drawable.computer);
            list.add(message);
        }
    }
}